package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.FoodinfoMapper;
import com.ruoyi.system.domain.Foodinfo;
import com.ruoyi.system.service.IFoodinfoService;

/**
 * 伙食信息汇总Service业务层处理
 *
 * @author ruoyi
 * @date 2023-12-27
 */
@Service
public class FoodinfoServiceImpl implements IFoodinfoService
{
    @Autowired
    private FoodinfoMapper foodinfoMapper;

    /**
     * 查询伙食信息汇总
     *
     * @param MealID 伙食信息汇总主键
     * @return 伙食信息汇总
     */
    @Override
    public Foodinfo selectFoodinfoByMealID(Long MealID)
    {
        return foodinfoMapper.selectFoodinfoByMealID(MealID);
    }

    /**
     * 查询伙食信息汇总列表
     *
     * @param foodinfo 伙食信息汇总
     * @return 伙食信息汇总
     */
    @Override
    public List<Foodinfo> selectFoodinfoList(Foodinfo foodinfo)
    {
        return foodinfoMapper.selectFoodinfoList(foodinfo);
    }

    /**
     * 新增伙食信息汇总
     *
     * @param foodinfo 伙食信息汇总
     * @return 结果
     */
    @Override
    public int insertFoodinfo(Foodinfo foodinfo)
    {
        return foodinfoMapper.insertFoodinfo(foodinfo);
    }

    /**
     * 修改伙食信息汇总
     *
     * @param foodinfo 伙食信息汇总
     * @return 结果
     */
    @Override
    public int updateFoodinfo(Foodinfo foodinfo)
    {
        return foodinfoMapper.updateFoodinfo(foodinfo);
    }

    /**
     * 批量删除伙食信息汇总
     *
     * @param MealIDs 需要删除的伙食信息汇总主键
     * @return 结果
     */
    @Override
    public int deleteFoodinfoByMealIDs(Long[] MealIDs)
    {
        return foodinfoMapper.deleteFoodinfoByMealIDs(MealIDs);
    }

    /**
     * 删除伙食信息汇总信息
     *
     * @param MealID 伙食信息汇总主键
     * @return 结果
     */
    @Override
    public int deleteFoodinfoByMealID(Long MealID)
    {
        return foodinfoMapper.deleteFoodinfoByMealID(MealID);
    }
}
